/*
** do_no_code.c for mm in /home/deubel_j//colle
** 
** Made by james deubelbeiss
** Login   <deubel_j@epitech.net>
** 
** Started on  Mon Apr 18 21:12:21 2011 james deubelbeiss
** Last update Mon Apr 18 22:34:34 2011 james deubelbeiss
*/

#include "my_mastermind.h"

int	my_strlen(char *s)
{
  int	i;

  i = 0;
  while (s[i])
    i++;
  return (i);
}

t_args	*do_no_code(t_args *ar)
{
  int	pions_len;
  int	slots;

  pions_len = my_strlen(ar->pions);
  srandom(time(0) * getpid());
  slots = ar->slots;
  while (slots != 0)
    {
      ar->code[slots - 1] = ar->pions[random()%pions_len];
      slots--;
    }
  return (ar);
}
